package com.example.file_management.mapper.material;

import com.example.file_management.pojo.material.Assessment;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
//public interface AssessmentMapper {

//    @Insert("INSERT INTO assessment (task_id, assessment_name, assessment_criteria, score, assessment_date, assessor) " +
//            "VALUES (#{taskId}, #{assessmentName}, #{assessmentCriteria}, #{score}, #{assessmentDate}, #{assessor})")
//    @Options(useGeneratedKeys = true, keyProperty = "assessmentId")
//    int insertAssessment(Assessment assessment);
//
//    @Select("SELECT * FROM assessment WHERE task_id = #{taskId}")
//    List<Assessment> getAssessmentsByTaskId(int taskId);
//
//    @Update("UPDATE assessment SET assessment_name = #{assessmentName}, assessment_criteria = #{assessmentCriteria}, " +
//            "score = #{score}, assessment_date = #{assessmentDate}, assessor = #{assessor} WHERE assessment_id = #{assessmentId}")
//    int updateAssessment(Assessment assessment);
//
//    @Delete("DELETE FROM assessment WHERE assessment_id = #{assessmentId}")
//    int deleteAssessment(int assessmentId);

public interface AssessmentMapper {
    int setAssessmentId(Assessment assessment);
    int insertAssessment(Assessment assessment);
    List<Assessment> getAssessmentsByTaskId(int taskId);
    int updateAssessment(Assessment assessment);
    int deleteAssessmentById(int assessmentId);
}

